package com.zhenzhen.xszhcp.serviceImpl;

import com.zhenzhen.xszhcp.mapper.GradeMapper;
import com.zhenzhen.xszhcp.model.Grade;
import com.zhenzhen.xszhcp.service.GradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
@Component
public class GradeServiceImpl implements GradeService {
    @Autowired
    private GradeMapper mapper;
    @Override
    public List<Grade> getGradeList(Map paramMap) {
        return mapper.getGradeList(paramMap);
    }

    @Override
    public Grade getGradeById(int id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public Grade getGradeByKandS(Map paramMap) {
        return mapper.getGradeByKandS(paramMap);
    }

    @Override
    public int insertGrade(Grade grade) {
        return mapper.insertSelective(grade);
    }

    @Override
    public int delGrade(int id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public int upGrade(Grade grade) {
        return mapper.updateByPrimaryKeySelective(grade);
    }

    @Override
    public int deleteBystudent(int st) {
        return mapper.deleteBystudent(st);
    }
}
